package com.example.demo.dao;

import com.example.demo.Board;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface BoardMapper {
    @Select("select id,content from matrix order by rand() limit 1")
    Board createBoard();//随机获取一行记录

    @Select("select content from matrix where id = #{id}")
    String getBoardById(int id);
}
